/**
 * karin on 2017/07/17
 * 微信公众号
 */
import React, { Component } from 'react'
import Style from './index.scss'


//引入
//import copy from 'copy-to-clipboard'   // 复制功能

import { Toast } from 'antd-mobile'   // 

import SendCxytjMessage from '../../utils/sendCxytjMessage'  // 埋点

export default class Cxywz2 extends Component {
	constructor(props) {
		super(props);

		this.state = {}
	}

	componentWillMount() {

	}

	/* 
	 * 事件
	 */
	copyFun() {
		SendCxytjMessage.sendMessage({ eventId: 'Insepection_OrderDetails_CopyWechat' })

	//	new Clipboard(this.refs.wxCopy)
		//	let word = 'cxywx2'
		//优雅降级:safari 版本号>=10,提示复制成功;否则提示需在文字选中后，手动选择“拷贝”进行复制

		Toast.info('复制成功!', 2)
		//word.clearSelection()


		//Toast.info('请选择“拷贝”进行复制!', 2)

	}

	/**
	 * 组件
	 */
	render() {

		return (
			<div className={Style.wxList}>
				<div ref='wxCopy' data-clipboard-action="copy" data-clipboard-target="div" onClick={() => this.copyFun()}></div>
				<img src="./images/cxywz2/bg.png" alt="" />
			</div>

		)
	}
}
  
Cxywz2.contextTypes = {
	router: React.PropTypes.object.isRequired
};

Cxywz2.defaultProps = {
}

